package tt.dz.entity.base;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;

/**
 * JsonForHardware
 * @param <T>
 * @param <T>
 */
public class JsonCommon<T> implements java.io.Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1461199278973391619L;
	private String code;
	private String msg;
	private T pojo;
	
	public JsonCommon() {
	}
	
	public JsonCommon(String code,String msg) {
		this.code = code;
		this.msg = msg;
	}
	public JsonCommon(T pojo,String code,String msg) {
		this.code = code;
		this.msg = msg;
		this.pojo = pojo;
	}
	
	public T getPojo() {
		return pojo;
	}
	public void setPojo(T pojo) {
		this.pojo = pojo;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	
	public String toJSONString(){
		return JSON.toJSONStringWithDateFormat(this, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteDateUseDateFormat);
	}
 
}
